INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/jasper)

SET(LIB_NAME OCGrib)

SET(TARGET_H
    degrib/tendian.h
    degrib/metaname.h
    degrib/scan.h
    degrib/myerror.h
    degrib/myassert.h
    degrib/myutil.h
    degrib/clock.h
    degrib/weather.h
    degrib/hazard.h
    degrib/inventory.h
    degrib/degrib1.h
    degrib/degrib2.h
    degrib/grib2api.h
    degrib/grib2.h
    degrib/gridtemplates.h
    degrib/drstemplates.h
    degrib/pdstemplates.h
    jasper/jp2_cod.h
    jasper/jp2_dec.h
    jasper/jas_icc.h
    jasper/jpc_dec.h
    GribDefine.h
    GribReader.h
    GribWrapper.h
    GribSyncFile.h
    GribVariable.h
    GribTime.h
    GribLevel.h
    GribOutput.h
    GribCompute.h
    GribDataReader.h
)

SET(TARGET_SRC
    src/GribCompute.cpp
    src/GribOutput.cpp
    src/GribTime.cpp
    src/GribLevel.cpp
    src/GribVariable.cpp
    src/GribSyncFile.cpp
    src/GribWrapper.cpp
    src/GribReader.cpp
    src/GribDataReader.cpp
    degrib/tendian.cpp
    degrib/grib1tab.cpp
    degrib/metaname.cpp
    degrib/metaparse.cpp
    degrib/scan.cpp
    degrib/myerror.cpp
    degrib/myassert.cpp
    degrib/myutil.cpp
    degrib/clock.cpp
    degrib/weather.cpp
    degrib/hazard.cpp
    degrib/inventory.cpp
    degrib/degrib1.cpp
    degrib/degrib2.cpp
    degrib/grib2api.cpp
    degrib/g2_info.cpp
    degrib/g2_getfld.cpp
    degrib/g2_free.cpp
    degrib/gridtemplates.cpp
    degrib/drstemplates.cpp
    degrib/pdstemplates.cpp
    degrib/gbits.cpp
    degrib/g2_unpack1.cpp
    degrib/g2_unpack2.cpp
    degrib/g2_unpack3.cpp
    degrib/g2_unpack4.cpp
    degrib/g2_unpack5.cpp
    degrib/g2_unpack6.cpp
    degrib/g2_unpack7.cpp
    degrib/rdieee.cpp
    degrib/simpack.cpp
    degrib/simunpack.cpp
    degrib/jpcpack.cpp
    degrib/jpcunpack.cpp
    degrib/specpack.cpp
    degrib/specunpack.cpp
    degrib/comunpack.cpp
    degrib/compack.cpp
    degrib/pack_gp.cpp
    degrib/dec_jpeg2000.cpp
    degrib/enc_jpeg2000.cpp
    degrib/mkieee.cpp
    degrib/reduce.cpp
    degrib/int_power.cpp
    jasper/jp2_cod.cpp
    jasper/jp2_dec.cpp
    jasper/jas_stream.cpp
    jasper/jas_init.cpp
    jasper/jas_malloc.cpp
    jasper/jas_image.cpp
    jasper/jas_debug.cpp
    jasper/jas_icc.cpp
    jasper/jas_iccdata.cpp
    jasper/jas_seq.cpp
    jasper/jas_cm.cpp
    jasper/jas_string.cpp
    jasper/jpc_dec.cpp
    jasper/jas_tvp.cpp
    jasper/jpc_bs.cpp
    jasper/jpc_cs.cpp
    jasper/jpc_math.cpp
    jasper/jpc_mct.cpp
    jasper/jpc_mqcod.cpp
    jasper/jpc_mqdec.cpp
    jasper/jpc_qmfb.cpp
    jasper/jpc_t1cod.cpp
    jasper/jpc_t1dec.cpp
    jasper/jpc_tsfb.cpp
    jasper/jpc_util.cpp
    jasper/jpc_tagtree.cpp
    jasper/jpc_t2dec.cpp
    jasper/jpc_t2cod.cpp
    jasper/jpc_enc.cpp
    jasper/jpc_mqenc.cpp
    jasper/jpc_t1enc.cpp
    jasper/jpc_t2enc.cpp
    jasper/jas_version.cpp
)

SETUP_GROUP()

SET(TARGET_LIBRARIES 
    OCMain
    OCVolume
    OCesium
)

ADD_DEFINITIONS(-DJAS_BUILDING_DLL)

SETUP_LIBRARY(${LIB_NAME})

ADD_DEPENDENCIES(${LIB_NAME} OCMain)
ADD_DEPENDENCIES(${LIB_NAME} OCVolume)

